<div class="loader"></div>
<div class="row" >
	<div class="col-md-12">
		<p class="success">
			Purchase Order ID #{{ $info->id }} has been successfully updated.
		</p>
	</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_po_number }}</strong></div>
	<div class="col-md-9">{{ strtoupper($info->vendor->code) }}-{{ str_pad($info->id, 3, '0', STR_PAD_LEFT) }}-{{ date_format($info->created_at, 'Ymd') }}</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_vendor }}</strong></div>
	<div class="col-md-9">{{ $info->vendor->name }}</div>
</div>
<div class="row">
	<div class="col-md-3"><strong>{{ $text_company }}</strong></div>
	<div class="col-md-9">{{ strtoupper($info->company_code) }}</div>
</div>

{{-- P. O. Creator Information --}}
<div class="row">
	<div class="col-md-3"><strong>{{ $text_created_by }}</strong></div>
	<div class="col-md-9"></strong>{{ $info->createdBy->firstname }} {{ $info->createdBy->lastname }}
	<small>{{ $text_at }}</small> {{ $info->created_at }}</div>
</div>

{{-- P. O. Modifier Information --}}
<div class="row">
	<div class="col-md-3"><strong>{{ $text_modified_by}}</strong></div>
	<div class="col-md-9">{{ $info->modifiedBy->firstname }} {{ $info->createdBy->lastname }} 
	<small>{{ $text_at }}</small> {{ $info->updated_at }}</div>
</div>

	{{-- P. O. Approver Information --}}
	@if ( $info->status == Constant::PO_APPROVED )
	<div class="row">
		<div class="col-md-3"><strong>{{ $text_approved_by }}</strong></div>
		<div class="col-md-9">{{ $info->approvedBy->firstname }} {{ $info->approvedBy->lastname }} 
			<small>{{ $text_at }}</small> {{ $info->approved_at }}</div>
		</div>
	</div>
	@endif
	
	{{-- Transfer Price --}}
	<div class="row">
		<div class="col-md-3"><strong>{{ $text_total_transfer_price }}</strong></div>
		<div class="col-md-9">{{ number_format($info->total_transfer_price,2) }}</div>
	</div>
@if ( !empty($po_items) )
<table class="table table-bordered table-striped table-hover">
	<tr>
		<td></td>
		<td>{{ $list_item_id }}</td>
		<td>{{ $list_product_id }}</td>
		<td>{{ $list_product_name }}</td>
		<td>{{ $list_product_model }}</td>
		<td>{{ $list_product_sku }}</td>
		<td>{{ $list_product_quantity }}</td>
		<td>{{ $list_product_srp }}</td>
		<td>{{ $list_product_transfer_price }}</td>
	</tr>

	@foreach ( $po_items as $item )
		<tr>
			<td>{{ ($info->status == Constant::PO_PENDING) ? Form::checkbox('purchase_order_product[' . $item->PURCHASE_ORDER_id . '][]', $item->id, null, [ 'class' => 'form-control po-product' ]) : ''}}</td>
			<td>{{ $item->ORDER_PRODUCT_id }}</td>
			<td>{{ $item->orderProduct->PRODUCT_id }}</td>
			<td>{{ $item->orderProduct->product->name }}</td>
			<td>{{ $item->orderProduct->product->code }}</td>
			<td>{{ $item->orderProduct->product->sku }}</td>
			<td>{{ $item->quantity }}</td>
			<td>{{ number_format($item->srp, 2) }}</td>
			<td>{{ number_format($item->transfer_price,2) }}</td>
		</tr>
	@endforeach
</tr>
</table>
@endif
@if($info->status == Constant::PO_APPROVED)
	<a href='' class="btn btn-success">Generate Sticker</a>
@endif
{{-- Download and Cancel Buttons --}}
<div class="row">
	<div class="col-md-8">
		<a href='{{ URL::to("po/export/{$info->id}/default/1") }}' class="btn btn-primary">Download Supplier PO</a>
		<a href='{{ URL::to("po/export/{$info->id}/acommerce/1") }}' class="btn btn-primary">Download Acommerce PO</a>

		@if ( $info->status == Constant::PO_APPROVED )
			<a href='{{ URL::to("po/generate-stickers/{$info->id}/1") }}' class="btn btn-primary btn-success" style="margin: 5px;">Generate Stickers</a>
		@endif
	</div>
	<div class="col-md-4 pull-right">
		{{ HTML::link( URL::previous(), $text_close, array('class' => 'btn btn-default', 'id'=> 'cancel')) }}
	</div>
</div>